#include<stdio.h>
#include<conio.h>
#include<math.h>

int KTsnt(int n)
{
	int i, dem=0;
	for(i=2;i<=sqrt(n);i++)
	  if(n%i==0)
	  dem++;
	  if(dem==0)
	  return 1;
	  else return 0;
}
 int isTwinPrime(int n)
 {
 	int kt;
 	if(KTsnt(n)==1 && KTsnt(n+2)==1 && KTsnt(n-2)==1)
	kt++;
	if(kt!=0)
	return 1;
	else return 0;
 }

 main()
{
	int n, kt=0;
	printf("Enter number:");
	scanf("%d", &n);
	if(isTwinPrime(n)==1)
	printf("The number is Twin prime.");
	 else printf("the number is not Twin prime.");
	getch();
}
